package com.ihelp.rest.mis.pojo;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;

/**
 * 平台登陆用户
*    
* 类名称：User   
* @version
 */
@Entity
@Table(name = "SYSUSER")
public class SysUser implements Serializable{
	
	public SysUser() {
		
	}

	public SysUser(String uuid, String name) {
		this.uuid = uuid;
		this.name = name;
	}

	private static final long serialVersionUID = 1L;

	@Id
    @Column(name = "UUID", length = 36)
	@GeneratedValue(generator = "paymentableGenerator")
	@GenericGenerator(name = "paymentableGenerator", strategy = "guid")
	private String uuid;
	
	/**
	 * 用户名称
	 */
	@Column(name = "NAME", length=40)
	private String name;
	
	/**
	 * 用户登陆账号
	 */
	@Column(name = "LOGIN_NAME", length=40)
	private String loginName;
	
	/**
	 * 用户密码
	 */
	@Column(name = "LOGIN_PASSWORD", length=40)
	private String loginPassword;
	
	/**
	 * 联系电话
	 */
	@Column(name = "PHONE", length=15)
	private String phone;
	
	/**
	 * 账号状态
	 * 1:可用
	 * 0:禁用
	 */
	@Column(name = "STATUS", columnDefinition="int(3) default 1")
	private Integer status;
	
	/**
	 * 用户类型
	 *  0:系统级
	 *  1:用户级
	 */
	@Column(name = "TYPE", columnDefinition="int(3) default 1")
	private Integer type;
	
	/**
	 * 用户角色
	 */
	@ManyToOne
	@JoinColumn(name="ROLE_ID")
	private Role role;
	
	/**
	 * 验证码不参与数据库存储
	 */
	@Transient
	private String validateCode;
	
	public String getValidateCode() {
		return validateCode;
	}

	public void setValidateCode(String validateCode) {
		this.validateCode = validateCode;
	}

	public Role getRole() {
		return role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public String getUuid() {
		return uuid;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getLoginName() {
		return loginName;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

	public String getLoginPassword() {
		return loginPassword;
	}

	public void setLoginPassword(String loginPassword) {
		this.loginPassword = loginPassword;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}
	
}
